<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layouts/layout">
<head>
<title>ProductList</title>
</head>
<body>

	<th:block layout:fragment="content">

		
<div class="container-wrapper">
    <div class="container">
        <div class="page-header">
            <h1>Add Product</h1>


            <p class="lead">Fill the below information to add a product:</p>
        </div>

        <form th:action="@{/admin/product/addProduct}" th:object="${product}" method="post" >
            <div class="form-group">
                <label for="productName">Name</label>
                <input type="text" th:field="*{productName}" class="form-control" />
				<p th:if="${#fields.hasErrors('productName')}" th:each="err : ${#fields.errors('productName')}" th:errors="*{productName}"  th:errorclass="fieldError"  th:text="${err}"></p>
                
            </div>

            <div class="form-group">
                <label for="productcategory">Category</label>
                <label class="checkbox-inline"><input type="radio" th:field="*{productcategory}" th:value="instrument" />Instrument</label>
                <label class="checkbox-inline"><input type="radio" th:field="*{productcategory}" th:value="record" />Record</label>
                <label class="checkbox-inline"><input type="radio" th:field="*{productcategory}" th:value="accessory" />Accessory</label>
            </div>

            <div class="form-group">
                <label for="productdescription">Description</label>
                
                <input type="text" th:field="*{productdescription}" class="form-control" />
            </div>

            <div class="form-group">
                <label for="productprice">Price</label>
                <input type="text" th:field="*{productprice}" class="form-control" />
				<p th:if="${#fields.hasErrors('productprice')}" th:each="err : ${#fields.errors('productprice')}" th:errors="*{productprice}"  th:errorclass="fieldError"  th:text="${err}"></p>
                
            </div>

            <div class="form-group">
                <label for="productcondition">Condition</label>
                <label class="checkbox-inline"><input type="radio" th:field="*{productcondition}" th:value="new" />New</label>
                <label class="checkbox-inline"><input type="radio" th:field="*{productcondition}" th:value="used" />Used</label>
            </div>

            <div class="form-group">
                <label for="productstatus">Status</label>
                <label class="checkbox-inline"><input type="radio" th:field="*{productstatus}" th:value="active" />Active</label>
                <label class="checkbox-inline"><input type="radio" th:field="*{productstatus}" th:value="inactive" />Inactive</label>
            </div>

            <div class="form-group">
                <label for="unitinstock">Unit In Stock</label>
                <input type="text" th:field="*{unitinstock}" class="form-control" />
				<p th:if="${#fields.hasErrors('unitinstock')}" th:each="err : ${#fields.errors('unitinstock')}" th:errors="*{unitinstock}"  th:errorclass="fieldError"  th:text="${err}"></p>
                
            </div>

            <div class="form-group">
                <label for="productmanufacturer">Manufacturer</label>
                <input type="text" th:field="*{productmanufacturer}" class="form-control" />
                
            </div>

            

        <br/><br/>

        <input type="submit" value="submit" class="btn btn-default" />
        <a th:href="@{/admin/productInventory}" class="btn btn-default">Cancel</a>

    </form>

			</div>
		</div>
	</th:block>


	<th:block layout:fragment="javascripts">
	
	</th:block>
</body>
</html>